1

Pick a city of the world to your liking and retrieve its bounding box. Then plot it: What do you see?
The function you may search is part of the osmdata package. Have a look at the slides.
dresden <-
  osmdata::getbb("Dresden")

plot(dresden)

# We see two points, which build the extremes of the bounding box.

2

Please choose one or two building types you are interested in and set them as key and value pairs. You can find a list of building types in the Overpass API documentation. But don’t forget to set the timeout query parameters first using the osmdata::opq() function.
First, you specify the bounding box like before, second, the query parameters, and third, the key and value pairs. Try to use a pipe workflow as it makes it a bit easier.
dresden <-
  osmdata::getbb("Dresden") %>% 
  osmdata::opq(timeout = 25*100) %>% 
  osmdata::add_osm_feature(
    key = "building", 
    value = c("house", "residential")
  )

3

Download the data using the osmadata::osmdata_sf() function and extract only the polygons.
The downloaded data are a list. The polygons are a named list element that you can extract with its name osm_polygons, just like a variable in a data table.
dresden <-
  osmdata::getbb("Dresden") %>% 
  osmdata::opq(timeout = 25*100) %>% 
  osmdata::add_osm_feature(
    key = "building", 
    value = c("house", "residential")
  ) %>% 
  osmdata::osmdata_sf() %>% 
  .$osm_polygons

4

Take some time to browse through the data. Depending on the building type you have chosen, you may find some interesting information. You can also plot the data you have just downloaded.
You may consider converting the data into a tibble using tibble::as_tibble() and maybe a sf::st_as_sf() afterwards for a nicer browsing experience.
library(tmap)

dresden <-
  osmdata::getbb("Dresden") %>% 
  osmdata::opq(timeout = 25*100) %>% 
  osmdata::add_osm_feature(
    key = "building", 
    value = c("house", "residential")
  ) %>% 
  osmdata::osmdata_sf() %>% 
  .$osm_polygons %>% 
  tibble::as_tibble() %>% 
  sf::st_as_sf()

dresden
## Simple feature collection with 14557 features and 122 fields
## Geometry type: POLYGON
## Dimension:     XY
## Bounding box:  xmin: 13.57913 ymin: 50.97482 xmax: 13.96545 ymax: 51.17778
## Geodetic CRS:  WGS 84
## # A tibble: 14,557 × 123
##    osm_id name  X3dr.type abandoned abandoned.man_m… access addr.city addr.country addr.housename addr.housenumber
##    <chr>  <chr> <chr>     <chr>     <chr>            <chr>  <chr>     <chr>        <chr>          <chr>           
##  1 22986… <NA>  <NA>      <NA>      <NA>             <NA>   Dresden   <NA>         <NA>           11              
##  2 22986… <NA>  <NA>      <NA>      <NA>             <NA>   Dresden   DE           <NA>           16              
##  3 22986… <NA>  <NA>      <NA>      <NA>             <NA>   Dresden   DE           <NA>           10              
##  4 22986… <NA>  <NA>      <NA>      <NA>             <NA>   Dresden   DE           <NA>           12              
##  5 22986… <NA>  <NA>      <NA>      <NA>             <NA>   Dresden   DE           <NA>           14              
##  6 22986… <NA>  <NA>      <NA>      <NA>             <NA>   Dresden   DE           <NA>           62              
##  7 22986… <NA>  <NA>      <NA>      <NA>             <NA>   Dresden   DE           <NA>           9               
##  8 22986… <NA>  <NA>      <NA>      <NA>             <NA>   Dresden   DE           <NA>           11a             
##  9 22986… <NA>  <NA>      <NA>      <NA>             <NA>   Dresden   DE           <NA>           11b             
## 10 22986… <NA>  <NA>      <NA>      <NA>             <NA>   Dresden   <NA>         <NA>           4               
## # … with 14,547 more rows, and 113 more variables: addr.postcode <chr>, addr.street <chr>, addr.suburb <chr>,
## #   addr.suburb.en <chr>, alt_name <chr>, amenity <chr>, architect <chr>, area <chr>, attraction <chr>,
## #   brand <chr>, brand.wikidata <chr>, building <chr>, building.architecture <chr>, building.colour <chr>,
## #   building.levelPlan <chr>, building.levels <chr>, building.levels.underground <chr>, building.material <chr>,
## #   building.part <chr>, building.roof <chr>, building.roof.colour <chr>, building.roof.shape <chr>,
## #   building.use <chr>, castle_type <chr>, check_date <chr>, cn_tud.token <chr>, colour <chr>, comment <chr>,
## #   community_centre <chr>, community_centre.for <chr>, construction <chr>, construction.building <chr>, …
tm_shape(dresden) +
  tm_polygons()